var a = getApp();

Page({
    data: {
        activeName: 0,
        loading: !1,
        dataList: [ {
            level: {},
            statistics: {},
            isLoadMore: !0,
            total_page: null,
            page: 1,
            list: []
        }, {
            level: {},
            statistics: {},
            isLoadMore: !0,
            total_page: null,
            page: 1,
            list: []
        } ]
    },
    onLoad: function(a) {
        this.getData({
            detail: {
                index: this.data.activeName
            }
        });
    },
    getData: function(t) {
        var e = t.detail.index, i = this;
        this.setData({
            loading: !0
        });
        var s = a.getNetAddresss("plugin.team-sideways.frontend.center.index");
        s += "&award_type=" + e, s += "&page=1", a._getNetWork({
            url: s,
            success: function(a) {
                if (1 === a.data.result) {
                    var t = i.data.dataList;
                    t[e].level = a.data.data.level, t[e].statistics = a.data.data.statistics, t[e].isLoadMore = !0, 
                    t[e].total_page = a.data.data.list.last_page, a.data.data.list.last_page || (t[e].total_page = 0), 
                    t[e].list = a.data.data.list.data, i.setData({
                        dataList: t,
                        activeName: e,
                        loading: !1
                    }), console.log(t);
                } else i.setData({
                    loading: !1
                }), wx.showToast({
                    title: a.data.msg,
                    icon: "none"
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    teamCode: function() {
        wx.navigateTo({
            url: "/packageE/extension/dealer_award/peerAwardes_withdraw/peerAwardes_withdraw"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.dataList[this.data.activeName].isLoadMore ? this.getData({
            detail: {
                index: this.data.activeName
            }
        }) : wx.showToast({
            title: "没有更多数据",
            icon: "none"
        });
    },
    onShareAppMessage: function() {}
});